<template>
  <Model-bg title="智慧车间" :width="476" :height="302" overflow="hidden">
    <video
      id="srceenVideo"
      loop
      muted
      autoplay
      :src="videoUrl"
      class="video"
      controls="controls"
      controlslist="nodownload"
    />
  </Model-bg>
</template>
<script>
import { screenPublicize } from "@/api/srceen/home";
export default {
  data() {
    return {
      videoUrl: {}, // 监控链接
      isFull: false, // 是否全屏
    };
  },
  mounted() {
    this.getList();
    document.addEventListener("fullscreenchange", this.handleKeyDown);
  },
  beforeUnmount() {
    window.removeEventListener("fullscreenchange", this.handleKeyDown);
  },
  methods: {
    // 获取视频链接
    getList() {
      screenPublicize().then((res) => {
        if (res.data) {
          this.videoUrl = res.data;
        }
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>
